import { interactiveLiveness } from "@kit.VisionKit";
import { BusinessError } from '@kit.BasicServicesKit';

export function startLivenessDetectionHarmonyOS(){
  if (canIUse('SystemCapability.AI.Component.LivenessDetect')) {
    let routerOptions: interactiveLiveness.InteractiveLivenessConfig =
      {
        isSilentMode: 'INTERACTIVE_MODE' as interactiveLiveness.DetectionMode,
        actionsNum: 1 ,
        routeMode: 'back' as interactiveLiveness.RouteRedirectionMode,
        speechSwitch:true,
        successfulRouteUrl:'',
        failedRouteUrl:'',
      }
    //@ts-ignore
    interactiveLiveness.startLivenessDetection(routerOptions).then((DetectState: boolean) => {
    })
  }else {
  }
  return "Harmony"
}